<?php include "./configs/session_check.php";
include "./configs/config.php";
sleep(1);

	$ProjectTitle=$_POST['ProjectTitle'];
    $DeadLine=$_POST['DeadLine'];
    $ProjectManager=$_POST['ProjectManager'];
    $Department=$_POST['Department'];
	$Section=$_POST['Section'];
     $query=("INSERT INTO Projects(ProjectTitle,DeadLine,ProjectManager,Department,Section) 			 VALUES('$ProjectTitle','$DeadLine','$ProjectManager','$Department','$Section')");
    $exc_query=mysql_query($query);
    if($exc_query ){
		$project_id=mysql_query("SELECT * FROM Projects ORDER BY ProjectID DESC LIMIT 1");
		$project_id_data=mysql_fetch_array($project_id);
        $return['msg'] = 'Project ID'.$project_id_data['ProjectID'].' Added';
    }
    else
    {
        $return['msg'] = 'Failed';
    }

echo json_encode($return);